package com.example.personnel_oa.controller;

import com.example.comment_oa.pojos.SysPost;
import com.example.comment_oa.response.AjaxResponse;
import com.example.personnel_oa.service.SysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("personnelOa")
public class SysPostController {
    @Autowired
    SysPostService postService;

    //查询出所有职位不包含懂事长
    @PostMapping("SysPost/post")
     public AjaxResponse post(){
         List<SysPost> post = postService.post();
         return AjaxResponse.success(post);
     }

     //根据岗位名称查到岗位id和部门id
     @PostMapping("SysPost/postDept/{postName}")
    public AjaxResponse postDept(@PathVariable("postName") String postName){
         SysPost post = postService.postDept(postName);
         return AjaxResponse.success(post);
     }
}
